angular.module('wf-utils')
.service('commonConstant', ($rootScope, $http)->
        pageTableCount:10
        modalTableCount:10
        tableCounts:[5,10,20]
        testBackEnd:'http://pkcrm.api.test.ostengar.com/pkcrm'
#        testBackEnd:'http://10.100.224.103:9001/pkcrm'
        sexList:(canEmpty)->##性别状态
            list = [
                {value:true, name:'男', remark:'man'},
                {value:false, name:'女', remark:'woman'},
            ];
            if(canEmpty == true)
                list.splice(0, 0, {value: undefined, name: '全部', remark: 'all'})
            list
        numSexList:(canEmpty)->##性别状态
            list = [
                {value:1, name:'男', remark:'man'},
                {value:2, name:'女', remark:'woman'}
#                {value:0, name:'保密', remark:'woman'}
            ];
            if(canEmpty == true)
                list.splice(0, 0, {value: undefined, name: '全部', remark: 'all'})
            list
        enabledList:(canEmpty)->##数据状态
            list= [
                {value:true,name:'启用',remark:'enable'}
                {value:false,name:'禁用',remark:'disable'}
            ]
            if (canEmpty == true)
                list.splice(0, 0, {value: undefined, name: '全部', remark: 'all'})
            list
        intEnabledList:(canEmpty)->##数据状态
            list= [
                {value:1,name:'启用',remark:'enable'}
                {value:0,name:'禁用',remark:'disable'}
            ]
            if (canEmpty == true)
                list.splice(0, 0, {value: undefined, name: '全部', remark: 'all'})
            list
        roleTypeList:(canEmpty)->
            list = [
                {value:1,name:'管理员',remark:'system'}
                {value:2,name:'业务人员',remark:'business'}
                {value:3,name:'客服',remark:'service'}
            ]
            if (canEmpty==true)
                list.splice(0, 0, {value: undefined, name: '全部', remark: 'all'})
            list
        authorizationTypeList:(canEmpty)->##权限类型
            list= [
                {value:1,name:'管理员',remark:'system'}
                {value:2,name:'业务人员',remark:'business'}
                {value:3,name:'客服',remark:'service'}
            ]
            if (canEmpty == true)
                list.splice(0, 0, {value: undefined, name: '全部', remark: 'all'})
            list
        menuLvList:(canEmpty)->#菜单层级
            list= [
                {value:1,name:'一级菜单'}
                {value:2,name:'二级菜单'}
            ]
            if (canEmpty == true)
                list.splice(0, 0, {value: undefined, name: '全部', remark: 'all'})
            list
        menuTypeList:(canEmpty)->#菜单类型（是否为叶子节点）
            list= [
                {value:true,name:'页面'}
                {value:false,name:'菜单'}
            ]
            if (canEmpty == true)
                list.splice(0, 0, {value: undefined, name: '全部', remark: 'all'})
            list
        resourceTypeList:(canEmpty)->##资源类型
            list=[
                {value:'uri', name:'API接口资源', remark:'url'},
                {value:'page', name:'页面资源', remark:'page'},
                {value:'button', name:'按钮资源', remark:'button'},
            ]
            if (canEmpty == true)
                list.splice(0, 0, {value: undefined, name: '全部', remark: 'all'})
            list
        methodTypeList:(canEmpty)->##uri方法
            list=[
                {value:'GET',name:'get方法',remark:'get'},
                {value:'POST',name:'post方法',remark:'post'},
                {value:'PUT',name:'put方法',remark:'put'},
                {value:'DELETE',name:'delete方法',remark:'delete'},
            ]
            if (canEmpty == true)
                list.splice(0, 0, {value: undefined, name: '全部', remark: 'all'})
            list
        #青果寓
        qgySexList:(canEmpty)->##性别状态
            list = [
                {value:1, name:'男', remark:'man'},
                {value:2, name:'女', remark:'woman'}
                {value:0, name:'保密', remark:''}
            ];
            if(canEmpty == true)
                list.splice(0, 0, {value: undefined, name: '全部', remark: 'all'})
            list
        roomActiveStatusList:(canEmpty)->
            list = [
                {value:1, name:'待出租'},
                {value:2, name:'已出租'}
                {value:4, name:'维修中'}
                {value:8, name:'已预定'}
            ];
            if(canEmpty == true)
                list.splice(0, 0, {value: undefined, name: '未选择', remark: 'all'})
            list
        houseStyleList:(canEmpty)->
            list = [
                {value:1, name:'欧式'},
                {value:2, name:'中式'},
                {value:3, name:'现代'},
                {value:4, name:'古典'}
            ];
            if(canEmpty == true)
                list.splice(0, 0, {value: undefined, name: '未选择', remark: 'all'})
            list
        orientationsList:(canEmpty)->
            list = [
                {value:1, name:'向东'},
                {value:2, name:'向南'},
                {value:3, name:'向西'},
                {value:4, name:'向北'}
            ];
            if(canEmpty == true)
                list.splice(0, 0, {value: undefined, name: '未选择', remark: 'all'})
            list
        payWayList:(canEmpty)->
            list = [
                {value:1, name:'押一付三'},
                {value:2, name:'押一付一'},
                {value:4, name:'租赁贷'},
                {value:8, name:'押一付六'},
                {value:16, name:'押一付12'}
            ];
            if(canEmpty == true)
                list.splice(0, 0, {value: undefined, name: '未选择', remark: 'all'})
            list
        transferpayWayList:(num)->
            payWayList=this.payWayList()
            list=[]
            if(num<1 || num!=parseInt(num) || num>31)
                return [];
            num_2_str = Array(5-num.toString(2).length).join(0)+num.toString(2);
            for val,index in num_2_str
                if val=='1'
                    list.push payWayList[4-index]
            list
        appointmentStatusList:(canEmpty)->
#            1-待沟通，2-待看房，3-已取消，4-已看房
            list = [
                {value:1, name:'待沟通'},
                {value:2, name:'待看房'},
                {value:3, name:'已取消'},
                {value:4, name:'已看房'},
            ];
            if(canEmpty == true)
                list.splice(0, 0, {value: undefined, name: '未选择', remark: 'all'})
            list
        contractStatusList:(canEmpty)->
#            list = [
#                {value:1, name:'未签约'},
#                {value:2, name:'已签约'},#已签约=已入住
#                {value:4, name:'已退租'},
#                {value:8, name:'已续约'},
#                {value:16, name:'已作废'}
#            ];
#            1-待签约，生成合同
#            2-已签约，合同确认，上传pdf
#            4-待入住，支付后就变成带入住
#            8-已入住，入住后
#            16-已退租，
#            32-已续约，
#            64-已换房，
#            128-已违约，
#            256-已转租，
#            512-已作废，30分钟没签约就作废
            list=[
                {value:2, name:'已签约'},#已签约=已入住
                {value:4, name:'待入住'},
                {value:8, name:'已入住'},
                {value:16, name:'已退租'},
                {value:32, name:'已续约'},
                {value:64, name:'已换房'},
                {value:128, name:'已违约'},
                {value:256, name:'已转租'}
            ];
            if(canEmpty == true)
                list.splice(0, 0, {value: undefined, name: '全部', remark: 'all'})
            list
        billStatusList:(canEmpty)->
            list = [
                {value:1, name:'未付款'},
                {value:2, name:'已付款'},
            ];
            if(canEmpty == true)
                list.splice(0, 0, {value: undefined, name: '全部', remark: 'all'})
            list

        leaseList:(canEmpty)->
            list = [
                {value:1, name:'一个月'},
                {value:2, name:'三个月'},
                {value:3, name:'六个月'},
                {value:4, name:'一年'},
                {value:5, name:'两年'}
            ];
            if(canEmpty == true)
                list.splice(0, 0, {value: undefined, name: '全部', remark: 'all'})
            list
        leaseBinList:(canEmpty)->
            list = [
                {value:1, name:'一个月'},
                {value:2, name:'三个月'},
                {value:4, name:'六个月'},
                {value:8, name:'一年'},
                {value:16, name:'两年'}
            ];
            if(canEmpty == true)
                list.splice(0, 0, {value: undefined, name: '全部', remark: 'all'})
            list
        offPayTypeList:(canEmpty)->
#            1-微信，2-支付宝，3-线下微信，4-线下支付宝，5-POS机
            list = [
                {value:3, name:'线下微信'},
                {value:4, name:'线下支付宝'},
                {value:5, name:'POS机'},
            ];
            if(canEmpty == true)
                list.splice(0, 0, {value: undefined, name: '全部', remark: 'all'})
            list
        allPayTypeList:(canEmpty)->
            list = [
                {value:1, name:'微信'},
                {value:2, name:'支付宝'},
                {value:3, name:'线下微信'},
                {value:4, name:'线下支付宝'},
                {value:5, name:'POS机'},
            ];
            if(canEmpty == true)
                list.splice(0, 0, {value: undefined, name: '全部', remark: 'all'})
            list
        offLeaseStatusList:(canEmpty)->
            #1-待处理，2-待确认，4-财务审核中，8-待退钱，16-已退租，32-已拒绝
            list = [
                {value:1, name:'待处理'},
                {value:2, name:'待确认'},
                {value:4, name:'财务审核中'},
                {value:8, name:'待退钱'},
                {value:16, name:'已退租'},
                {value:32, name:'已拒绝'}
            ];
            if(canEmpty == true)
                list.splice(0, 0, {value: undefined, name: '全部', remark: 'all'})
            list
        financeStatusList:(canEmpty)->
            #1-待处理，2-待确认，4-审核中，8-待退钱，16-已退租，32-已拒绝
            list = [
                {value:4, name:'审核中'},
                {value:8, name:'待退钱'},
                {value:16, name:'已退钱'},
                {value:32, name:'已拒绝'}
            ];
            if(canEmpty == true)
                list.splice(0, 0, {value: undefined, name: '全部', remark: 'all'})
            list
        chiChannelTypeList:(canEmpty)->
            list = angular.copy($rootScope.contractChannel)
            if(canEmpty == true)
                list.splice(0, 0, {value: undefined, name: '全部', remark: 'all'})
            list
        applyOperationList:(canEmpty)->
#            1-退租，2-续约，3-换房，4-转租
            list = [
                {value:1, name:'退租'},
                {value:2, name:'续约'},
                {value:3, name:'换房'}
                {value:4, name:'转租'}
            ];
            if(canEmpty == true)
                list.splice(0, 0, {value: undefined, name: '全部', remark: 'all'})
            list
        applyStatusList:(canEmpty)->
#            1-待处理，2-处理中，4-已处理
            list = [
                {value:1, name:'待处理'},
#                {value:2, name:'处理中'},
                {value:4, name:'已处理'}
            ];
            if(canEmpty == true)
                list.splice(0, 0, {value: undefined, name: '全部', remark: 'all'})
            list
        repairStatusList:(canEmpty)->
#            1-待沟通，2-待维修，4-待评价，8-已评价
            list = [
                {value:1, name:'待沟通'},
                {value:2, name:'待维修'},
                {value:4, name:'待评价'},
                {value:8, name:'已评价'}
            ];
            if(canEmpty == true)
                list.splice(0, 0, {value: undefined, name: '全部', remark: 'all'})
            list
        cotenantStatusList:(canEmpty)->
            list = [
                {value:1, name:'在住'},
                {value:0, name:'不在住'}
            ];
            if(canEmpty == true)
                list.splice(0, 0, {value: undefined, name: '全部', remark: 'all'})
            list
        lightDarkList:(canEmpty)->
            list = [
                {value:true, name:'明间'},
                {value:false, name:'暗间'}
            ];
            if(canEmpty == true)
                list.splice(0, 0, {value: undefined, name: '全部', remark: 'all'})
            list
        qgyGoodStatusList:(canEmpty)->
            list = [
                {value:true, name:'上线'},
                {value:false, name:'下线'}
            ];
            if(canEmpty == true)
                list.splice(0, 0, {value: undefined, name: '全部', remark: 'all'})
            list
        qgyCleaningOrderStatusList:(canEmpty)->
#            1-待支付，2-待服务，3-待评价，4-已评价，5-已取消
            list = [
                {value:1, name:'待支付'},
                {value:2, name:'待服务'}
                {value:3, name:'待评价'}
                {value:4, name:'已评价'}
                {value:5, name:'已取消'}
            ];
            if(canEmpty == true)
                list.splice(0, 0, {value: undefined, name: '全部', remark: 'all'})
            list

        qgyRentalOrderStatusList:(canEmpty)->
#            1-待支付，2-待领取，3-租赁中，4-已归还
            list = [
                {value:1, name:'待支付'},
                {value:2, name:'待领取'}
                {value:3, name:'租赁中'}
                {value:4, name:'已归还'}
            ];
            if(canEmpty == true)
                list.splice(0, 0, {value: undefined, name: '全部', remark: 'all'})
            list
        qgyScoreOrderStatusList:(canEmpty)->
            list = [
                {value:1, name:'待支付'},
                {value:2, name:'待领取'}
                {value:3, name:'已领取'}
            ];
            if(canEmpty == true)
                list.splice(0, 0, {value: undefined, name: '全部', remark: 'all'})
            list
        qgyCityList:(canEmpty)->
            list = angular.copy($rootScope.qgyCity)
            if(canEmpty == true)
                list.splice(0, 0, {value: undefined, name: '全部', remark: 'all'})
            list
        #活动
        activeCostTypeList:(canEmpty)->
            list=[
                {value:1,name:'免费'},
                {value:2,name:'报名收费'},
                {value:3,name:'现场收费'}
            ]
            if (canEmpty == true)
                list.splice(0, 0, {value: undefined, name: '全部', remark: 'all'})
            list
        needVerifyList:(canEmpty)->
            list=[
                {value:false,name:'不用验证'},
                {value:true,name:'需要验证'}
            ]
            if (canEmpty == true)
                list.splice(0, 0, {value: undefined, name: '全部', remark: 'all'})
            list
        enterFeeTypeList:(canEmpty)->
            list=[
                {value:false,name:'免费'},
                {value:true,name:'收费'}
            ]
            if (canEmpty == true)
                list.splice(0, 0, {value: undefined, name: '全部', remark: 'all'})
            list
        activeStatusList:(canEmpty)->
            list=[
                {value:0,name:'待审批'},
                {value:1,name:'待进行'}
                {value:2,name:'进行中'}
                {value:3,name:'已结束'}
                {value:4,name:'已拒绝'}
            ]
            if (canEmpty == true)
                list.splice(0, 0, {value: undefined, name: '全部', remark: 'all'})
            list
        activeParamTypeList:(canEmpty)->
            #1输入框，2单选，3多选，4下拉框
            list=[
                {value:1,name:'输入框'},
                {value:2,name:'单选框'},
                {value:3,name:'多选框'},
                {value:4,name:'下拉框'},
            ]
            if (canEmpty == true)
                list.splice(0, 0, {value: undefined, name: '全部', remark: 'all'})
            list
        activeParamRequiredList:(canEmpty)->
            list=[
                {value:false,name:'选填字段'},
                {value:true,name:'必填字段'},
            ]
            if (canEmpty == true)
                list.splice(0, 0, {value: undefined, name: '全部', remark: 'all'})
            list
        ##价格体系
        priceChannelList:(canEmpty)->
            list=[
                {value:1,name:'线上'},
                {value:2,name:'线下'}
            ]
            if (canEmpty == true)
                list.splice(0, 0, {value: undefined, name: '全部', remark: 'all'})
            list
        priceSettleWayList:(canEmpty)->
            list=[
                {value:1,name:'租金立减'},
                {value:2,name:'租金折扣'}
            ]
            if (canEmpty == true)
                list.splice(0, 0, {value: undefined, name: '全部', remark: 'all'})
            list
        promotionSettleWayList:(canEmpty)->
            list=[
                {value:1,name:'租金立减'},
                {value:2,name:'租金折扣'}
                {value:4,name:'优惠'}
                {value:8,name:'送积分'}
            ]
            if (canEmpty == true)
                list.splice(0, 0, {value: undefined, name: '全部', remark: 'all'})
            list
        rebateSettleWayList:(canEmpty)->
            list=[
                {value:4,name:'优惠'}
                {value:8,name:'送积分'}
            ]
            if (canEmpty == true)
                list.splice(0, 0, {value: undefined, name: '全部', remark: 'all'})
            list
        priceStatusList:(canEmpty)->
            list=[
                {value:1,name:'正常'},
                {value:0,name:'禁用'}
            ]
            if (canEmpty == true)
                list.splice(0, 0, {value: undefined, name: '全部', remark: 'all'})
            list
        #系统通知
        notificationReadFlagList:(canEmpty)->
            list=[
                {value:true,name:'已读'},
                {value:false,name:'未读'}
            ]
            if (canEmpty == true)
                list.splice(0, 0, {value: undefined, name: '全部', remark: 'all'})
            list
        notificationBuzTypeList:(canEmpty)->
#            1-系统通知 2-门店通知 3-账单通知 4-预定通知 5-备忘录，6合同到期通知
            list=[
                {value:1,name:'系统通知'},
                {value:2,name:'门店通知'}
                {value:3,name:'账单通知'}
                {value:4,name:'预定通知'}
                {value:5,name:'备忘录'}
                {value:6,name:'合同到期通知'}
            ]
            if (canEmpty == true)
                list.splice(0, 0, {value: undefined, name: '全部', remark: 'all'})
            list
        notificationTypeList:(canEmpty)->
#            1-全局，2-私信，3-门店
            list=[
                {value:1,name:'全局'},
                {value:2,name:'私信'}
                {value:3,name:'门店'}
            ]
            if (canEmpty == true)
                list.splice(0, 0, {value: undefined, name: '全部', remark: 'all'})
            list


)